<?xml version='1.0' encoding='UTF-8' ?>
<!DOCTYPE composition PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">


<ui:composition xmlns:ui="http://xmlns.jcp.org/jsf/facelets"
                template="./resources/mastersPages/MasterPage.xhtml"
                xmlns:h="http://xmlns.jcp.org/jsf/html"
                xmlns:f="http://xmlns.jcp.org/jsf/core"
                xmlns="http://www.w3.org/1999/xhtml">




    <ui:define name="content">
        
        <h:form acceptcharset="ISO-8859-1" lang="pt_BR">
            <h:messages   styleClass="alert-success" style="width: 800px; height: 50px; border-radius: 10px" id="divMesangensSucesso" />
            <h:messages   styleClass="alert-danger" style="width: 800px; height: 50px; border-radius: 10px" id="divMesangensErro" />



            <h:inputHidden value="#{setorMB.setorBO.idSetor}" id="hfIdSetor"  />
            <h1><i class="glyphicon glyphicon-edit"></i>Cadastrar Setor</h1>
            
            <fieldset>
                <legend></legend>
                <div id="divID" class="row full">

                    <div class="form-group  col-sm-1  ">

                        <label>Id</label>
                        <h:inputText disabled="true" class="form-control" value="#{setorMB.setorBO.idSetor}" />
                    </div>
                    <div class="form-group col-sm-6">
                        <label>Nome Setor</label>
                        <h:inputText class="form-control" required="true" value="#{setorMB.setorBO.nomeSetor}"/>
                    </div>
                </div>

                <div id="divDadosIniciais" class="row full">

                    <div class="form-group col-sm-2" >
                        <label ID="lblinstituicao">Intituição</label>
                        <h:selectOneMenu class="input input-sm" label="lblinstituicao" value="#{setorMB.setorBO.instituicaoBO}" 
                                         converter="conversorInstituicao" required="true">
                            <f:selectItem noSelectionOption="true" itemLabel="Selecione uma instituição." itemValue="-1" 
                                          />
                            <f:selectItems  value="#{setorMB.instituicoes}" var="instituicao" 
                                            itemLabel="#{instituicao}" 
                                            itemValue="#{instituicao}" 
                                            />
                        </h:selectOneMenu>
                    </div>
                </div>
                <div id="divDadosIniciais" class="row full">
                    <div class="form-group col-sm-7">
                        <label>Descrição</label>
                        <h:inputTextarea  class="form-control" value="#{setorMB.setorBO.descricaoSetor}" rows="5"/>
                    </div>
                </div>
                <div class="row full">
                    <div class="form-group col-sm-8">

                        <label>Status</label>
                        <h:selectOneRadio value="#{setorMB.setorBO.status}" style="margin-left: 10px;">
                            <f:selectItem itemValue="1" itemLabel="Ativo" />
                            <f:selectItem  itemValue="2" itemLabel="Inativo"  />
                        </h:selectOneRadio>
                    </div>
                </div>
                <h:commandLink action="#{setorMB.novo()}" class="btn btn-primary" >
                    <i class="glyphicon glyphicon-plus"></i>Novo
                </h:commandLink>       
                <h:commandLink class="btn btn-info" action="#{setorMB.salvar()}" style="margin-left: 30px;">
                    <i class="glyphicon glyphicon-floppy-saved"></i>
                    Salvar
                </h:commandLink>       
            </fieldset>            
        </h:form>
    </ui:define>

</ui:composition>
